package com.xbell.dahua.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class StaticResourceConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射 /flv/** 到项目根目录下的 flv 文件夹
        registry.addResourceHandler("/file/flv/**")
                .addResourceLocations("file:stream/");
    }
} 